Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: add the ability to deprecate a prebuilt provider #370

Merged
merged 9 commits into from
Dec 15, 2023

Conversation

xiehan
Copy link
Contributor

@xiehan xiehan commented Dec 12, 2023

While this is not technically a breaking change, I want to force this to be released as v0.5.0 so that it's easier to roll back to v0.4.x in case there are any issues with this in testing.

At its core, this change is relatively simple: it introduces an isDeprecated flag on the config for providers built using this project that defaults to falsy. All the new behavior is controlled by that flag, so it should mean that this is safe to merge, as no new functionality will be triggered for any providers unless/until they are marked as deprecated.

(There technically is also a new option called deprecationDate -- in practice I don't intend to use that and will just rely on the build date; however, in order to not have the test snapshots be regenerated every day with a new date, I needed a way to force-override the new Date() behavior.)

If the isDeprecated flag is set to true, then the following happens:

  • The "should-release" logic is removed because we want to force one final release
  • The "provider upgrade" and "upgrade-main" workflows are removed to avoid any accidental updates before the repo is archived
  • The text in the README will have a disclaimer about the deprecated status of this package added to it, and the sections about Versioning and Contributing that are no longer relevant will be removed
  • The Go package will be marked as deprecated -- see here for how this is done in Go
  • The NPM package will be marked as deprecated after the next and final release

PyPi and Maven unfortunately don't support deprecating an entire package. NuGet does, but there's no API/CLI for it; it has to be done via the web UI.

While it's huge, looking at the test snapshot file might be the best way to visualize the changes. The first example in that file is of a provider that's been marked as deprecated -- in particular, scrolling down to the README will demonstrate what that looks like for a deprecated provider. The other snapshots demonstrate that there shouldn't be any unintentional outcomes for providers that have not been explicitly marked as deprecated.

Side note: while I was working on this I realized that hashicorp/terraform-cdk#2575 is very important now because we link to https://cdk.tf/imports a lot to explain how to manually generate bindings, but some of the examples there incorrectly use the prebuilt providers, so I have added that issue to our next release.

@xiehan xiehan force-pushed the deprecation-workflow branch from 71dfad0 to 8d6bd59 Compare December 14, 2023 11:52
@xiehan xiehan changed the title feat: add the ability to deprecate a prebuilt provider feat!: add the ability to deprecate a prebuilt provider Dec 14, 2023
@xiehan xiehan marked this pull request as ready for review December 14, 2023 12:18
@xiehan xiehan requested a review from a team as a code owner December 14, 2023 12:18
@xiehan xiehan requested review from mutahhir and ansgarm and removed request for a team December 14, 2023 12:18
@DanielMSchmidt DanielMSchmidt merged commit fbad220 into main Dec 15, 2023
8 checks passed
@DanielMSchmidt DanielMSchmidt deleted the deprecation-workflow branch December 15, 2023 13:09
xiehan added a commit to cdktf/cdktf-repository-manager that referenced this pull request Dec 15, 2023
cdktf/cdktf-provider-project#370 must be merged and published before
this has any effect.
Copy link

I'm going to lock this pull request because it has been closed for at least 7 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems related to this change, please open a new issue so we can investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants